home *** CD-ROM | disk | FTP | other *** search
- on listaSubTextos primLin, moveSumario
- -- gLinhasSubTexto contera o numero total de linhas dos
- -- subtextos
- global gLinhasSubTexto, gSumarioLinha
- put primLin into gSumarioLinha
- put 0 into gLinhasSubTexto
- put 1 into subTitulo
- put 0 into textoUsado
- put - primLin into linha
- put the number of member 11 of castLib "Verbetes" into memTexto
- put (the number of member "SubTitulos") - 1 into memSubTit
- put [0, 1, 2, 15, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,¬
- 13, 14, 16, 17] into ordem
-
- repeat while subTitulo <= 17
- set idx = getAt(ordem, subTitulo+1)
-
- -- Calcula tamanho do texto
- if the type of member (memTexto + idx) = #field then
- put the lineCount of member (memTexto + idx) into numLin
- if numLin = 1 then
- if the text of member (memTexto + idx) = "x" then
- put 0 into numLin
- end if
- end if
- else
- set numLin = 0
- end if
- put gLinhasSubTexto + numLin into gLinhasSubTexto
-
- if numLin > 0 and linha + numLin > 0 and linha < 14 then
- -- Ajusta posicao e tamanho do texto
- set the puppet of sprite 16 + textoUsado to true
- set the loc of sprite 16 + textoUsado to ¬
- point(145,145+linha*16)
- set the member of sprite 16 + textoUsado to¬
- member (memTexto + idx)
- sendSprite(16+textoUsado,#setMidia, 1, idx)
- -- Controla subtitulos
- if linha >= 0 then
- puppetSprite 2 + textoUsado,true
- set the member of sprite 2 + textoUsado to¬
- (memSubTit + idx)
- set the locV of sprite 2 + textoUsado to 240 + 16 * linha
- else
- -- Subtitulo aparece fora da tela
- set the locV of sprite 2 + textoUsado to 960
- puppetSprite 2 + textoUsado,true
- end if
- set textoUsado = textoUsado + 1
- end if
- -- Proximo subTitulo, se ainda houver espaco
- put subTitulo + 1 into subTitulo
- set linha = linha + numLin
- end repeat
-
- -- Apaga as linhas que porventura sobraram
- repeat while textoUsado < 14
- set the locV of sprite 2 + textoUsado to 960
- set the locV of sprite 16 + textoUsado to 960
- put textoUsado+1 into textoUsado
- end repeat
-
- if moveSumario <> -1 then
- if (gLinhasSubTexto <= 14) then
- -- sumarioIndicador 0
- set the visibility of sprite 33 to false
- set the visibility of sprite 30 to false
- else
- set the visibility of sprite 33 to true
- set the visibility of sprite 30 to true
- sumarioIndicador gSumarioLinha * 10000 / (gLinhasSubTexto - 14)
- end if
- end if
- end
-
- on sumarioIndicador pos
- put (352 - 164) * pos / 10000 + 164 into y
- set the locV of sprite 33 to y
- end
-
- on sumarioScroll n
- global gLinhasSubTexto, gSumarioLinha
- if gSumarioLinha + n > gLinhasSubTexto - 14 then
- put gLinhasSubTexto - 14 - gSumarioLinha into n
- end if
- if gSumarioLinha + n < 0 then
- put - gSumarioLinha into n
- end if
- listaSubTextos gSumarioLinha + n
- end